---
title: "Transition Duration"
description: "Utilities for controlling the duration of CSS transitions."
---

import plugin from 'tailwindcss/lib/plugins/transitionDuration'
import { Variants } from '@/components/Variants'
import { Disabling } from '@/components/Disabling'

export const classes = { plugin }

## Usage

Use the `duration-{amount}` utilities to control an element's transition-duration.

```html emerald
<template preview>
  <div class="flex justify-around items-center">
    <button class="transition duration-150 ease-in-out transform hover:scale-125 bg-emerald-600 text-white font-semibold py-3 px-6 rounded-md">
      Hover me
    </button>
    <button class="transition duration-300 ease-in-out transform hover:scale-125 bg-emerald-600 text-white font-semibold py-3 px-6 rounded-md">
      Hover me
    </button>
    <button class="transition duration-700 ease-in-out transform hover:scale-125 bg-emerald-600 text-white font-semibold py-3 px-6 rounded-md">
      Hover me
    </button>
  </div>
</template>

<button class="transition **duration-150** ease-in-out ...">Hover me</button>
<button class="transition **duration-300** ease-in-out ...">Hover me</button>
<button class="transition **duration-700** ease-in-out ...">Hover me</button>
```

## Responsive

To control an element's transition-duration at a specific breakpoint, add a `{screen}:` prefix to any existing transition-duration utility. For example, use `md:duration-500` to apply the `duration-500` utility at only medium screen sizes and above.

For more information about Tailwind's responsive design features, check out the [Responsive Design](/docs/responsive-design) documentation.

## Customizing

### Duration values

By default, Tailwind provides eight general purpose transition-duration utilities. You change, add, or remove these by customizing the `transitionDuration` section of your Tailwind theme config.

```diff-js
  // tailwind.config.js
  module.exports = {
    theme: {
      extend: {
        transitionDuration: {
+         '0': '0ms',
+         '2000': '2000ms',
        }
      }
    }
  }
```

Learn more about customizing the default theme in the [theme customization documentation](/docs/theme#customizing-the-default-theme).

### Variants

<Variants plugin="transitionDuration" name="transition-duration" />

### Disabling

<Disabling plugin="transitionDuration" name="transition-duration" />
